package results;

import java.io.Serializable;
import utils.*;
import objects.Sink;
import java.util.*;
import communication.pack.*;

import kernel.*;

public class ProbeDataSink extends ProbeSink {

    private static final String PROPERTY_NAME = "ProbeDataSink";

    public ProbeDataSink(Sink s, String p) {
	super(s,p);
    }

    public Object getValue() {
	Vector<SensorData> sd = ((Sink)_linkedStation).getDataCache();
	Vector<String> result = new Vector<String>();
	for(SensorData current : sd) {
	    String res = current.getRequestId() + " : " + current.getSenderId() + "\n";
	    result.add(res);
	}
	return result;
    }

	/**
	 * Get the property Name
	 * @return property name
	 * @see Results.Probe#getPropertyName()
	 */
	public String getPropertyName() {
		return PROPERTY_NAME;
	}

	/**
	 * Get the descitption of the probe
	 * @return probe description
	 * @see Results.Probe#getProbeDescription()
	 */
	public String getProbeDescription() {
	    return "";
	}
    
}
